   

                   ▄████████▄                     
                 ▄█▀▒▒▒▒▒▒▒▀██▄
               ▄█▀▒▒▒▒▒▒▒▒▒▒▒██
             ▄█▀▒▒▒▒▒▒▄▒▒▒▒▒▒▐█▌
            ▄█▒▒▒▒▒▒▒▒▀█▒▒▒▒▒▐█▌
           ▄█▒▒▒▒▒▒▒▒▒▒▀█▒▒▒▄██
          ▄█▒▒▒▒▒▒▒▒▒▒▒▒▀█▒▄█▀█▄
         ▄█▒▒▒▒▒▒▒▒▒▒▒▒▒▒██▀▒▒▒█▄
        ▄█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█▄
       ▄█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█▄  
      ▄█▒▒▒▄██████▄▒▒▒▒▄█████▄▒▒▒▒█
      █▒▒▒█▀░░░░░▀█ ▒▒▒█▀░░░░▀█▒▒▒█              @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
      █▒▒▒█░░▄░░░░▀████▀░░░▄░░█▒▒▒█              >             	                             <
    ▄███▄▒█▄░▐▀▄░░░░░░░░░▄▀▌░▄█▒▒███▄            >             	                             <
    █▀░░█▄▒█░▐▐▀▀▄▄▄ ▄▄▄▀▀▌▌░█▒▒█░░▀█            >             	                             <
    █░░░░█▒█░▐▐  ▄▄ █ ▄▄  ▌▌░█▒█░░░░█            >          How to edit Donkey Kong          <
    █░▄░░█▒█░▐▐▄ ▀▀ █ ▀▀ ▄▌▌░█▒█░░▄░█	         >          -----------------------          <
    █░░█░█▒█░░▌▄█▄▄▀ ▀▄▄█▄▐░░█▒█░█░░█            >                titlescreen                <
    █▄░█████████▀░░▀▄▀░░▀█████████░▄█            >                -----------                <
     ██▀░░▄▀░░▀░░▀▄░░░▄▀░░▀░░▀▄░░▀██             >                                           <
    ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██            >           Author: Crying Onion            <
    █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█            >                Version 1.0                <
    █░▄░░░░░░░░░░░░░░░░░░░░░░░░░░░▄░█            >              Date: 10/11/2020             <
    █░▀█▄░░░░░░░░░░░░░░░░░░░░░░░▄█▀░█            >             	                             <
    █░░█▀███████████████████████▀█░░█            >             	                             <
    █░░█    █   █   █   █   █    █░░█            >                                           <
    █░░▀█   █   █   █   █   █   █▀░░█            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    █░░░▀█▄▄█▄▄▄█▄▄▄█▄▄▄█▄▄▄█▄▄█▀░░░█
    ▀█░░░█  █   █   █   █   █  █░░░█▀
     ▀█░░▀█▄█   █   █   █   █▄█▀░░█▀
      ▀█░░░▀▀█▄▄█   █   █▄▄█▀▀░░░█▀
       ▀█░░░░░▀▀█████████▀▀░░░░░█▀
        ▀█░░░░░▄░░░░░░░░░▄░░░░░█▀
         ▀██▄░░░▀▀▀▀▀▀▀▀▀░░░▄██▀
            ▀██▄▄░░░░░░░▄▄██▀
               ▀▀███████▀▀



	1) Introduction

	2) Where to start and the different bytes/values to edit

	3) A small example

______________________________________________________________________________________________


	1) Introduction

Good news! Learning how to edit the title screen of a NES game is easy, and it's a process
shared by 90% of games.

Now the bad news: This game belongs to the 10% who use their own system XD.I would bet that
many Nintendo launch titles for this console use this peculiar system, but this is the first
example that I have found.

As I have not found previous tutorials (I found some useful information in old posts in the
forum, but that's all), I have decided to share with you what I have learned.

______________________________________________________________________________________________


	2) Where to start and the different bytes/values to edit


The titlescreen code starts in the address 003905, with groups of 4 bytes for each tile shown.
Taking as an example the first 4 bytes, 20, 83, C5 and 62, now I will explain what function
each one has and its variables:

	·1st byte: The screen is divided into two quadrants. Value '20' equals upper quadrant
	 and '21' equals lower quadrant

	·2nd byte: The position of the tile on the screen. In the example of the first byte
	 group it is '83'. If you change it to '82' you will move the tile to the previous space.

Note1 If you want to move a tile up or down, you have to change the value until the tile
reaches the edge of the screen. Example: If with 'F8' the tile reaches the right edge of the
screen, with 'F9' it appears just at the left edge of the next vertical row.

Note2 To do that, It's important to know too that the lowest values go from 0 to 9 and then from
A to F. Example: The value after 0F is 10, the value after 19 is 1A, etc.

	·3rd byte: This value tells the tile how it should be displayed on the screen.
	 There are 3 options:

		01: Prints a single tile

		C5: C is a command that prints one or more consecutive tiles vertically. The
		accompanying number indicates how many times it prints.

		42: The same as C, but horizontally. The accompanying number indicates how many
		times it prints.

	·4th byte: This value indicates what tile should be displayed. '62' is the common tile
	 displayed in DK titlescreen. '24' prints a black/empty tile.

FYI In fact, yo can use any tile loaded in the PPU memory. To know what value a tile has, we use
the PPU Viewer (integrated in many emulators, such as FCEUX). It will open a window that displays
information such as the color palette or the tiles that the game is using at that exact moment.
Just by passing the mouse pointer over the tile we are interested in, it will show us at the
bottom of the window the value of that tile.

_________________________________________________________________________________________________


	3) A small example


Just for practice, here is an example of how to convert the first letter of 'Donkey' into an 'A',
starting from the first four byte group of the title screen (address 003905):

	·The first 4 bytes print in the upper quadrant (20), in the position (83) a vertical row
	 of 5 (C5) tiles (62).

	·The next 4 bytes print in the upper quadrant (20), in position (84) a horizontal row of
	 3 (43) tiles.

	·The next 4 bytes print in the upper quadrant (20), in position (85) another vertical row
	 of 5 (C5) tiles (62).

	·The last group of 4 bytes is the only one that gives some work, because we must lower the
	 tile. We can count the exact amount of spaces and calculate the value, although we can
	 also do it by "trial and error", changing the value exaggeratedly to see if we approach
	 and go correcting. This can be complicated, cause if we move it over another tile we will
	 not see it. It's a matter of patience. At the end we print in the upper quadrant (20),
	 in the position (C4) one (01) tile (62).